<?php
/**@package     Joomla.Site
 * @subpackage  com_content
 * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params  = $this->item->params;
$images  = json_decode($this->item->images);
$urls    = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user    = JFactory::getUser();
$info    = $params->get('info_block_position', 0);
JHtml::_('behavior.caption');
$Itemid = JRequest::getVar('Itemid','');
$id = JRequest::getVar('id','');
$db = & JFactory::getDBO();
$sqlitem="SELECT * from #__content where id='".$id."' and state=1";
$db->setQuery($sqlitem);
$contentdetail = $db->loadObjectList();
$lang = JRequest::getVar('lang','');
if($lang=="en"){$linkform = "http://wmcvietnam.com/en/news-year";}
else{$linkform = "http://wmcvietnam.com/vi/tin-tuc-cua-nam";}

if($this->item->catid==52 || $this->item->catid==53 || $this->item->catid==54 || $this->item->catid==55 || $this->item->catid==56 || $this->item->catid==57 || $this->item->catid==58 || $this->item->catid==59 || $this->item->catid==60 || $this->item->catid==61 || $this->item->catid==62 || $this->item->catid==63 || $this->item->catid==64 || $this->item->catid==65 || $this->item->catid==66 || $this->item->catid==67){
?>
<div class="item-page<?php echo $this->pageclass_sfx?>">
	<div class="page-header">
		<h2><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
	</div>
    <div class="contentmain">
    	<h2 class="titleh4"><?php echo $this->escape($this->item->title); ?></h2>
        <h4 class="titleh4small"><?php echo JText::_('Job Description');?>:</h4>
        <div class="contentjobitem"><?php echo $this->item->text;?></div>
        <h4 class="titleh4small"><?php echo JText::_('Job Requirement');?>:</h4>
        <div class="contentjobitem"><?php echo $contentdetail[0]->descrequirement;?></div>
        <h4 class="titleh4small"><?php echo JText::_('Location');?>:</h4>
        <div class="contentjobitem"><?php echo $contentdetail[0]->desclocation;?></div>
        <div class="formsubmitjob">
        	<h4 class="titleh4"><?php echo JText::_('Submit CV');?></h4>
        	{rsform 1}
        </div>
        <?php
        $document = &JFactory::getDocument();
        $renderer   = $document->loadRenderer('modules');
        $position   = 'categoriesjob';
        $options   = array('style' => 'none');
        echo $renderer->render($position, $options, null);
        ?>
    </div>
</div>
<?php
}
else if($this->item->catid==9){
?>
<div class="item-page<?php echo $this->pageclass_sfx?>">
	<?php if ($this->params->get('show_page_heading') && $params->get('show_title')) : ?>
	<div class="page-header">
		<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
	</div>
	<?php endif;
	if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
	{
		echo $this->item->pagination;
	}
	?>
	<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
	<div class="page-header">
		<h2 class="wmc_heading">
			<?php if ($this->item->state == 0) : ?>
				<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
			<?php endif; ?>
			<?php if ($params->get('show_title')) : ?>
				<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
					<a href="<?php echo $this->item->readmore_link; ?>"> <?php echo $this->escape($this->item->title); ?></a>
				<?php else : ?>
					<?php echo $this->escape($this->item->title); ?>
				<?php endif; ?>
			<?php endif; ?>
        
		<?php 
		//$itemId = JRequest::getVar("Itemid");
		//if( ($itemId == 142) || ($itemId == 146) || ($itemId == 147) ||($itemId == 148) ||($itemId == 149) ||($itemId == 150) ||($itemId == 151) || ($itemId == 164)):
		
		//echo "<pre>";print_r($rowitems);
		
		if(!empty($contentdetail[0]->button_reservation) && ($contentdetail[0]->button_reservation != "0")):
	?>
	<a href="<?php echo $contentdetail[0]->button_reservation;?>#<?php echo $lang;?>"><div class="reservation reservation_<?php echo $lang; ?>"></div></a>
	
	<?php endif;?>
		</h2>
	</div>
	<?php endif; ?>
    <div class="contentmain">
	<?php if (!$this->print) : ?>
		<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
		<div class="btn-group pull-right">
			<a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <span class="icon-cog"></span> <span class="caret"></span> </a>
			<?php // Note the actions class is deprecated. Use dropdown-menu instead. ?>
			<ul class="dropdown-menu actions">
				<?php if ($params->get('show_print_icon')) : ?>
				<li class="print-icon"> <?php echo JHtml::_('icon.print_popup', $this->item, $params); ?> </li>
				<?php endif; ?>
				<?php if ($params->get('show_email_icon')) : ?>
				<li class="email-icon"> <?php echo JHtml::_('icon.email', $this->item, $params); ?> </li>
				<?php endif; ?>
                <li class="face-icon"> 
                	<a href="http://www.facebook.com/sharer.php?u=<?php echo $this->baseurl; ?>/index.php?option=com_content&view=article&id=<?php echo $id;?>&Itemid=134" target="_blank">
                    	<span class="icon-face"></span>
                        Facebook
                    </a>
                </li>
                <li class="linkin-icon"> 
                	<a href="http://www.linkedin.com/shareArticle?mini=true&ro=false&trk=bookmarklet&title='<?php echo $this->escape($this->item->title); ?>'&url=<?php echo $this->baseurl; ?>/index.php?option=com_content&view=article&id=<?php echo $id;?>&Itemid=134" target="_blank">
                    	<span class="icon-linkin"></span>
                        LinkedIn
                    </a>
                </li>
				<?php if ($canEdit) : ?>
				<li class="edit-icon"> <?php echo JHtml::_('icon.edit', $this->item, $params); ?> </li>
				<?php endif; ?>
			</ul>
		</div>
		<?php endif; ?>
		<?php else : ?>
		<div class="pull-right">
		<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
		</div>
	<?php endif; ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
	|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author')); ?>
	<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
		<div class="article-info muted">
			<dl class="article-info">
			<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>

			<?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
				<dd class="createdby">
					<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
					<?php if (!empty($this->item->contactid) && $params->get('link_author') == true) : ?>
						<?php
						$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
						$menu = JFactory::getApplication()->getMenu();
						$item = $menu->getItems('link', $needle, true);
						$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
						?>
						<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author)); ?>
					<?php else: ?>
						<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
					<?php endif; ?>
				</dd>
			<?php endif; ?>
			<?php if ($params->get('show_parent_category') && !empty($this->item->parent_slug)) : ?>
				<dd class="parent-category-name">
					<?php $title = $this->escape($this->item->parent_title);
					$url = '<a href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)).'">'.$title.'</a>';?>
					<?php if ($params->get('link_parent_category') && !empty($this->item->parent_slug)) : ?>
						<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
					<?php else : ?>
						<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
					<?php endif; ?>
				</dd>
			<?php endif; ?>
			<?php if ($params->get('show_category')) : ?>
				<dd class="category-name">
					<?php $title = $this->escape($this->item->category_title);
					$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)) . '">' . $title . '</a>';?>
					<?php if ($params->get('link_category') && $this->item->catslug) : ?>
						<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
					<?php else : ?>
						<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
					<?php endif; ?>
				</dd>
			<?php endif; ?>

			<?php if ($params->get('show_publish_date')) : ?>
				<dd class="published">
					<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
				</dd>
			<?php endif; ?>

			<?php if ($info == 0) : ?>
				<?php if ($params->get('show_modify_date')) : ?>
					<dd class="modified">
						<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
					</dd>
				<?php endif; ?>
				<?php if ($params->get('show_create_date')) : ?>
					<dd class="create">
						<span class="icon-calendar"></span> <?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->created, JText::_('DATE_FORMAT_LC3'))); ?>
					</dd>
				<?php endif; ?>

				<?php if ($params->get('show_hits')) : ?>
					<dd class="hits">
						<span class="icon-eye-open"></span> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
					</dd>
				<?php endif; ?>
			<?php endif; ?>
			</dl>
		</div>
	<?php endif; ?>

	<?php if (!$params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?>
	<?php echo $this->item->event->beforeDisplayContent; ?>

	<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
		|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
	<?php echo $this->loadTemplate('links'); ?>
	<?php endif; ?>
	<?php if ($params->get('access-view')):?>
	<?php if (isset($images->image_fulltext) && !empty($images->image_fulltext)) : ?>
	<?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?>
	<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
	<?php if ($images->image_fulltext_caption):
		echo 'class="caption"'.' title="' .htmlspecialchars($images->image_fulltext_caption) . '"';
	endif; ?>
	src="<?php echo htmlspecialchars($images->image_fulltext); ?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>"/> </div>
	<?php endif; ?>
	<?php
	if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative):
		echo $this->item->pagination;
	endif;
	?>
	<?php if (isset ($this->item->toc)) :
		echo $this->item->toc;
	endif; ?>
    
	<?php 
	$db = & JFactory::getDBO();
	$sqlcareer="SELECT * from #__content where id='".$id."' and state=1";
	$db->setQuery($sqlcareer);
	$rows = $db->loadObjectList();	
	
	if($Itemid == 134){
		echo '<div class="titlecareer">'.JText::_('Job Description').'</div>';
		echo $this->item->text;
		echo '<div class="titlecareer">'.JText::_('Job Requirement').'</div>';
		echo $rows[0]->descrequirement;
		echo '<div class="titlecareer">'.JText::_('Location').'</div>';
		echo $rows[0]->desclocation;
		
		$document = &JFactory::getDocument();
		$renderer   = $document->loadRenderer('modules');
		$position   = 'position-6';
		$options   = array('style' => 'raw');
		echo $renderer->render($position, $options, null);
		
		
	$sqlcareerothertitle="SELECT * from #__categories where id='".$rows[0]->catid."' and published=1";
	$db->setQuery($sqlcareerothertitle);
	$sqlcareerotherstitle = $db->loadObjectList();
	
	$sqlcareerother="SELECT * from #__content where id<>'".$id."' and catid='".$rows[0]->catid."' and state=1";
	$db->setQuery($sqlcareerother);
	$sqlcareerothers = $db->loadObjectList();		
		
		echo '<div class="titleother">'.JText::_('Other job').' '.$sqlcareerotherstitle[0]->title.'</div>';
		echo '<div class="otherarticle">';
			for($i=0;$i<count($sqlcareerothers);$i++){
				echo '<a href="'.$this->baseurl.'/index.php?option=com_content&view=article&id='.$sqlcareerothers[$i]->id.'&Itemid=134">'.$sqlcareerothers[$i]->title.'</a>';
			}
		echo '</div>';
		
	}
	else{
		echo $this->item->text; 
	}
	?>

	<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
		<div class="article-info muted">
			<dl class="article-info">
			<dt class="article-info-term"><?php echo JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>

			<?php if ($info == 1) : ?>
				<?php if ($params->get('show_author') && !empty($this->item->author )) : ?>
					<dd class="createdby">
						<?php $author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
						<?php if (!empty($this->item->contactid) && $params->get('link_author') == true) : ?>
						<?php
						$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
						$menu = JFactory::getApplication()->getMenu();
						$item = $menu->getItems('link', $needle, true);
						$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
						?>
						<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author)); ?>
						<?php else: ?>
						<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
						<?php endif; ?>
					</dd>
				<?php endif; ?>
				<?php if ($params->get('show_parent_category') && !empty($this->item->parent_slug)) : ?>
					<dd class="parent-category-name">
						<?php	$title = $this->escape($this->item->parent_title);
						$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug)) . '">' . $title . '</a>';?>
						<?php if ($params->get('link_parent_category') && $this->item->parent_slug) : ?>
							<?php echo JText::sprintf('COM_CONTENT_PARENT', $url); ?>
						<?php else : ?>
							<?php echo JText::sprintf('COM_CONTENT_PARENT', $title); ?>
						<?php endif; ?>
					</dd>
				<?php endif; ?>
				<?php if ($params->get('show_category')) : ?>
					<dd class="category-name">
						<?php 	$title = $this->escape($this->item->category_title);
						$url = '<a href="' . JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)) . '">' . $title . '</a>';?>
						<?php if ($params->get('link_category') && $this->item->catslug) : ?>
							<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url); ?>
						<?php else : ?>
							<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title); ?>
						<?php endif; ?>
					</dd>
				<?php endif; ?>
				<?php if ($params->get('show_publish_date')) : ?>
					<dd class="published">
						<span class="icon-calendar"></span>
						<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON', JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?>
					</dd>
				<?php endif; ?>
			<?php endif; ?>

			<?php if ($params->get('show_create_date')) : ?>
				<dd class="create">
					<span class="icon-calendar"></span>
					<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
				</dd>
			<?php endif; ?>
			<?php if ($params->get('show_modify_date')) : ?>
				<dd class="modified">
					<span class="icon-calendar"></span>
					<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED', JHtml::_('date', $this->item->modified, JText::_('DATE_FORMAT_LC3'))); ?>
				</dd>
			<?php endif; ?>
			<?php if ($params->get('show_hits')) : ?>
				<dd class="hits">
					<span class="icon-eye-open"></span> <?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS', $this->item->hits); ?>
				</dd>
			<?php endif; ?>
			</dl>
		</div>
	<?php endif; ?>

	<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative):
	echo $this->item->pagination;
?>
	<?php endif; ?>
	<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
	<?php echo $this->loadTemplate('links'); ?>
	<?php endif; ?>
	<?php //optional teaser intro text for guests ?>
	<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
	<?php echo $this->item->introtext; ?>
	<?php //Optional link to let them register to see the whole article. ?>
	<?php if ($params->get('show_readmore') && $this->item->fulltext != null) :
		$link1 = JRoute::_('index.php?option=com_users&view=login');
		$link = new JURI($link1);?>
	<p class="readmore">
		<a href="<?php echo $link; ?>">
		<?php $attribs = json_decode($this->item->attribs); ?>
		<?php
		if ($attribs->alternative_readmore == null) :
			echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
		elseif ($readmore = $this->item->alternative_readmore) :
			echo $readmore;
			if ($params->get('show_readmore_title', 0) != 0) :
				echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
			endif;
		elseif ($params->get('show_readmore_title', 0) == 0) :
			echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
		else :
			echo JText::_('COM_CONTENT_READ_MORE');
			echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
		endif; ?>
		</a>
	</p>
	<?php endif; ?>
	<?php endif; ?>
	<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
	echo $this->item->pagination;
?>
	<?php endif; ?>
	<?php echo $this->item->event->afterDisplayContent; ?> 
</div>
</div>
<?php
}
else if($this->item->catid==46||$this->item->catid==47||$this->item->catid==48||$this->item->catid==49||$this->item->catid==50){
$db = & JFactory::getDBO();
$sqlitem="SELECT * from #__content where id='".$id."' and state=1";
$db->setQuery($sqlitem);
$rowitems = $db->loadObjectList();
$sqlrelate="SELECT * from #__content where catid='".$rowitems[0]->catid."' and state=1";
$db->setQuery($sqlrelate);
$rowrelates = $db->loadObjectList();

$restaurantname=$rowitems[0]->metadata;
$restaurantname=explode('"xreference":"',$restaurantname);
$restaurantname=explode('"',$restaurantname[1]);
$restaurantname=$restaurantname[0];
$idres="";
if	($restaurantname=="ccad"		){$idres = 18;}
elseif($restaurantname=="amigo"		){$idres = 19;}
elseif($restaurantname=="ccnh"		){$idres = 17;}
elseif($restaurantname=="ducbao"	){$idres = 20;}
elseif($restaurantname=="kissho"	){$idres = 22;}
elseif($restaurantname=="nd"		){$idres = 21;}
elseif($restaurantname=="tott"		){$idres = 23;}
elseif($restaurantname=="wph"		){$idres = 5;}
elseif($restaurantname=="spa"		){$idres = 8;}
elseif($restaurantname=="vipcard"	){$idres = 74;}
elseif($restaurantname=="wmc"		){$idres = 3;}
elseif($restaurantname=="thelong"	){$idres = 104;}
elseif($restaurantname=="sherwood"	){$idres = 6;}
elseif($restaurantname=="reverie"	){$idres = 39;}
elseif($restaurantname=="randj"	){$idres = 117;}
elseif($restaurantname=="longtrieu"	){$idres = 78;}

$sqlrestaurant="SELECT * from #__content where id='".$idres."' and state=1";
$db->setQuery($sqlrestaurant);
$rowrestaurant = $db->loadObjectList();
?>
<div class="page-header">
    <h2 class="wmc_heading"> <?php echo $rowitems[0]->title; ?> 
	
	<?php 
		//$itemId = JRequest::getVar("Itemid");
		//if( ($itemId == 142) || ($itemId == 146) || ($itemId == 147) ||($itemId == 148) ||($itemId == 149) ||($itemId == 150) ||($itemId == 151) || ($itemId == 164)):
		
		//echo "<pre>";print_r($rowitems);
		
		if(!empty($contentdetail[0]->button_reservation) && ($contentdetail[0]->button_reservation != "0")):
	?>
	<a href="<?php echo $contentdetail[0]->button_reservation;?>#<?php echo $lang;?>"><div class="reservation reservation_<?php echo $lang; ?>"></div></a>
	
	<?php endif;?>
	</h2>
</div>
<div class="contentmain">
	<?php
	$imageintro = $rowitems[0]->images;
	$imageintro = explode('","',$imageintro);
	$imageintro = explode('":"',$imageintro[0]);
	$imageintro = str_replace('\/','/',$imageintro[1]);
	?>
    <div class="postcontent nobottommargin">
        <div class="single-portfolio-image">
        	<img src="<?php echo $imageintro;?>" />
        </div>
    </div>
    
    <div class="portfolio-meta nobottommargin col_last">
		<div class="single-portfolio-description">
			<ul class="desc">
				<li>
                	<?php
                    $logoarticle = $rowrestaurant[0]->images;
					$logoarticle = explode('image_fulltext":"',$logoarticle);
					$logoarticle = explode('","',$logoarticle[1]);
					$logoarticle = str_replace('\/','/',$logoarticle[0]);
					if(strlen($logoarticle)>1){echo '<img class="logoarticle" src="'.$logoarticle.'" />';}
					?>
					<h4>
					<?php
						if($this->item->catid==10){echo JText::_('Working with Us:');}
						else{echo JText::_('Description');}
					?>
					</h4>
					<p>
						<?php echo $rowrestaurant[0]->introtext; ?>
                    </p>
                    <p>
						<?php echo $rowrestaurant[0]->fulltext; ?>
                    </p>
				</li>
            </ul>
		</div>
	</div>
    <div class="descriptionoffer">
    	<?php echo $rowitems[0]->introtext; ?>
        <?php echo $rowitems[0]->fulltext; ?>
    </div>
	<?php
    if(count($rowrelates)>1 && $this->item->catid!=15){
	?>
    
	<div class="doubleline"></div>

    <div class="related-projects-wrap clearfix ourporfolio">
		<h3><?php echo JText::_('Other Offers');?></h3>
		<div id="home-portfolio-list" class="clearfix">
            <div id="portfolio" class="portfolio-normal clearfix">
			<?php
            //fitter menu id
            $wordfind = 'view=article';
            $sqlmenu="SELECT * from #__menu where link like '%$wordfind%' and published=1";
            $db->setQuery($sqlmenu);
            $rowitemidmenus = $db->loadObjectList();
            //fitter menu id
            for($i=0;$i<count($rowrelates);$i++){
                
                //fitter menu id
                $Itemidmenu = "";
                for($m=0;$m<count($rowitemidmenus);$m++){
                    $idarticle = $rowitemidmenus[$m]->link;
                    $idarticle = explode('&id=',$idarticle);
                    if($idarticle[1]==$rowrelates[$i]->id){$Itemidmenu = $rowitemidmenus[$m]->id;}
                }
                if($Itemidmenu!=""){
                    $itemidneed = "&Itemid=".$Itemidmenu;
                }
                //fitter menu id
                
                $imageintrorelate = $rowrelates[$i]->images;
                $imageintrorelate = explode('","',$imageintrorelate);
                $imageintrorelate = explode('":"',$imageintrorelate[0]);
                $imageintrorelate = str_replace('\/','/',$imageintrorelate[1]);
                
                $linkrelate='index.php?option=com_content&view=article&id='.$rowrelates[$i]->id.':'.$rowrelates[$i]->alias.'&catid='.$rowrelates[$i]->catid.$itemidneed;
            ?>
                <div class="portfolio-item">
                    <div class="portfolio-image">
                        <a href="<?php echo $linkrelate;?>"><img src="<?php echo $imageintrorelate;?>" />
                            <div class="item-overlay overlay-icon-pic"><span></span></div>
                        </a>
                    </div>
                    <div class="portfolio-desc"><h3><a href="<?php echo $linkrelate;?>"><?php echo $rowrelates[$i]->title; ?></a></h3></div>
                </div>
            <?php
            }
            ?>
            </div>
            <div class="portfolio-navigation">
                <a href="#" id="home-portfolio-prev" class="portfolio-prev">Previous</a> 
                <a href="#" id="home-portfolio-next" class="portfolio-next">Next</a>
            </div>
            <div id="home-portfolio-pagination"></div>
            <script type="text/javascript">
			jQuery("#portfolio").carouFredSel({
				circular:false,
				responsive:true,auto:false,
				items:{width:300,visible:{min:1,max:4}},
				scroll:{duration:900,easing:"easeOutExpo",wipe:true},
				prev:{button:"#home-portfolio-prev",key:"left"},
				next:{button:"#home-portfolio-next",key:"right"},
				pagination:"#home-portfolio-pagination"});
			</script>
		</div>
        
	</div>
    <?php
	}
	?>
</div>
<?php
}
else if($this->item->catid==47 || $this->item->catid==48 || $this->item->catid==49 || $this->item->catid==50){
$db = & JFactory::getDBO();
$sqlitem="SELECT * from #__content where id='".$id."' and state=1";
$db->setQuery($sqlitem);
$rowitems = $db->loadObjectList();
$sqlrelate="SELECT * from #__content where catid='".$rowitems[0]->catid."' and state=1";
$db->setQuery($sqlrelate);
$rowrelates = $db->loadObjectList();
?>
<div class="page-header">
    <h2 class="wmc_heading"> <?php echo $rowitems[0]->title; ?> 
	
	<?php 
		//$itemId = JRequest::getVar("Itemid");
		//if( ($itemId == 142) || ($itemId == 146) || ($itemId == 147) ||($itemId == 148) ||($itemId == 149) ||($itemId == 150) ||($itemId == 151) || ($itemId == 164)):
		
		//echo "<pre>";print_r($rowitems);
		
		if(!empty($rowitems[0]->button_reservation) && ($rowitems[0]->button_reservation != "0")):
	?>
	<a href="<?php echo $rowitems[0]->button_reservation;?>#<?php echo $lang;?>"><div class="reservation reservation_<?php echo $lang; ?>"></div></a>
	
	<?php endif;?>
	
	</h2>
</div>
<div class="contentmain">
	<?php
		$imageintro = $rowitems[0]->images;
		$imageintro = explode('","',$imageintro);
		$imageintro = explode('":"',$imageintro[0]);
		$imageintro = str_replace('\/','/',$imageintro[1]);
	?>
    <div class="postcontent nobottommargin">
        <div class="single-portfolio-image">
                <img src="<?php echo $imageintro;?>" />
        </div>
    </div>
    <div class="portfolio-meta nobottommargin col_last">
		<div class="single-portfolio-description">
			<ul class="desc">
				<li>
                	<?php
                    $logoarticle = $rowitems[0]->images;
					$logoarticle = explode('image_fulltext":"',$logoarticle);
					$logoarticle = explode('","',$logoarticle[1]);
					$logoarticle = str_replace('\/','/',$logoarticle[0]);
					if(strlen($logoarticle)>1){echo '<img class="logoarticle" src="'.$logoarticle.'" />';}
					?>
					<h4>
					<?php
						if($this->item->catid==10){echo JText::_('Working with Us:');}
						else{echo JText::_('Description');}
					?>
					</h4>
					<p><?php echo $rowitems[0]->introtext; ?></p>
                    <p><?php echo $rowitems[0]->fulltext; ?></p>
				</li>
            </ul>
		</div>
	</div>
	<?php
    if(count($rowrelates)>1 && $this->item->catid!=15){
	?>
    
	<div class="doubleline"></div>

    <div class="related-projects-wrap clearfix ourporfolio">
		<h3><?php echo JText::_('Our Managed Properties');?></h3>
		<div id="home-portfolio-list" class="clearfix">
            <div id="portfolio" class="portfolio-normal clearfix">
			<?php
            //fitter menu id
            $wordfind = 'view=article';
            $sqlmenu="SELECT * from #__menu where link like '%$wordfind%' and published=1";
            $db->setQuery($sqlmenu);
            $rowitemidmenus = $db->loadObjectList();
            //fitter menu id
            for($i=0;$i<count($rowrelates);$i++){
                
                //fitter menu id
                $Itemidmenu = "";
                for($m=0;$m<count($rowitemidmenus);$m++){
                    $idarticle = $rowitemidmenus[$m]->link;
                    $idarticle = explode('&id=',$idarticle);
                    if($idarticle[1]==$rowrelates[$i]->id){$Itemidmenu = $rowitemidmenus[$m]->id;}
                }
                if($Itemidmenu!=""){
                    $itemidneed = "&Itemid=".$Itemidmenu;
                }
                //fitter menu id
                
                $imageintrorelate = $rowrelates[$i]->images;
                $imageintrorelate = explode('","',$imageintrorelate);
                $imageintrorelate = explode('":"',$imageintrorelate[0]);
                $imageintrorelate = str_replace('\/','/',$imageintrorelate[1]);
                
                $linkrelate='index.php?option=com_content&view=article&id='.$rowrelates[$i]->id.':'.$rowrelates[$i]->alias.'&catid='.$rowrelates[$i]->catid.$itemidneed;
            ?>
                <div class="portfolio-item">
                    <div class="portfolio-image">
                        <a href="<?php echo $linkrelate;?>"><img src="<?php echo $imageintrorelate;?>" />
                            <div class="item-overlay overlay-icon-pic"><span></span></div>
                        </a>
                    </div>
                    <div class="portfolio-desc"><h3><a href="<?php echo $linkrelate;?>"><?php echo $rowrelates[$i]->title; ?></a></h3></div>
                </div>
            <?php
            }
            ?>
            </div>
            <div class="portfolio-navigation">
                <a href="#" id="home-portfolio-prev" class="portfolio-prev">Previous</a> 
                <a href="#" id="home-portfolio-next" class="portfolio-next">Next</a>
            </div>
            <div id="home-portfolio-pagination"></div>
            <script type="text/javascript">
			jQuery("#portfolio").carouFredSel({
				circular:false,
				responsive:true,auto:false,
				items:{width:300,visible:{min:1,max:4}},
				scroll:{duration:900,easing:"easeOutExpo",wipe:true},
				prev:{button:"#home-portfolio-prev",key:"left"},
				next:{button:"#home-portfolio-next",key:"right"},
				pagination:"#home-portfolio-pagination"});
			</script>
		</div>
        
	</div>
    <?php
	}
	?>
</div>
<?php
}
else if($this->item->catid==33 && $this->item->id==51){
	$wordfind = $_POST['yearnewsofinput'];
	$db = & JFactory::getDBO();
	$sqlcatyear="SELECT * from #__content where catid='14' and publish_up like '%$wordfind%' and state=1 order by id desc";
	$db->setQuery($sqlcatyear);
	$rowcatyears = $db->loadObjectList();
	/*print_r($rowcatyears);*/
	//echo $this->item->id;
?>
<div class="page-header">
    <h2 class="wmc_heading"><?php echo $this->escape($this->item->title); ?>
	
	<?php 
		//$itemId = JRequest::getVar("Itemid");
		//if( ($itemId == 142) || ($itemId == 146) || ($itemId == 147) ||($itemId == 148) ||($itemId == 149) ||($itemId == 150) ||($itemId == 151) || ($itemId == 164)):
		
		//echo "<pre>";print_r($rowitems);
		
		if(!empty($contentdetail[0]->button_reservation) && ($contentdetail[0]->button_reservation != "0")):
	?>
	<a href="<?php echo $contentdetail[0]->button_reservation;?>#<?php echo $lang;?>"><div class="reservation reservation_<?php echo $lang; ?>"></div></a>
	
	<?php endif;?>
	</h2>
</div>
<div class="contentmain">
	<div class="leftcontent newswmc">
        <div class="contentnews">
        <?php
        for($i=0;$i<count($rowcatyears);$i++){
			$imageintro = $rowcatyears[$i]->images;
			$imageintro = explode('","',$imageintro);
			$imageintro = explode('":"',$imageintro[0]);
			$imageintro = str_replace('\/','/',$imageintro[1]);
			$linkrelate='index.php?option=com_content&view=article&id='.$rowcatyears[$i]->id.':'.$rowcatyears[$i]->alias.'&catid='.$rowcatyears[$i]->catid.'&Itemid=109';
		?>
        	<div class="ja-zincontent-wrap">
                <div class="ja-zincontent clearfix ">
                	<?php
                    if($imageintro != ""){
					?>
                    <div class="ja-zincontent-img left ">
						<?php
                        if($this->item->id==54){
                        ?>
                        <a target="_blank" href="http://issuu.com/wmcgroup/docs/wmc_aspire_-_q2_2014?e=12049362/7942170">
                            <img align="left" class="left" style="opacity: 1; visibility: visible;" src="<?php echo $imageintro; ?>">					
                        </a>
                        <?php 	
                        }
                        else{
                        ?>
                            <img align="left" class="left" style="opacity: 1; visibility: visible;" src="<?php echo $imageintro; ?>">					
                        <?php
                        }
                        ?>
                    </div>
                    <?php
					}
					?>
                    <h4 class="ja-zintitle">
                        <a href="<?php echo $linkrelate; ?>">
							<?php echo $this->escape($rowcatyears[$i]->title); ?>
                        </a>
                    </h4>
                    <div class="ja-zinintro">
                        <p class="datepublish"><?php echo JHtml::_('date', $rowcatyears[$i]->publish_up, JText::_('DATE_FORMAT_LC3')); ?></p>
                        <div class="contentnews">
                            <?php echo $rowcatyears[$i]->introtext;?>
                        </div>
                    </div>
                </div>
            </div>
        <?php
		}
		?>   
        </div>
    </div>
    <div class="rightcontent slidernews">
    	
        <script src="templates/protostar/js/jquery-ui.js"></script>
		<script>
        jQuery(function() {
            var tabCounter = 2;
            var tabs = jQuery( "#tabs" ).tabs();
            tabs.bind( "keyup", function( event ) {
                if ( event.altKey && event.keyCode === jQuery.ui.keyCode.BACKSPACE ) {
                    var panelId = tabs.find( ".ui-tabs-active" ).remove().attr( "aria-controls" );
                    jQuery( "#" + panelId ).remove();
                    tabs.tabs( "refresh" );
                }
            });
        });
		function formyearnews(yearnewsinput){
			var f=document.getElementById('yearnews');
			document.getElementById('yearnewsofinput').value = yearnewsinput;
			f.submit();
		}
        </script>
        <div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                <li aria-selected="true" aria-controls="tabs-1" class="ui-state-default ui-corner-top">
                    <a id="ui-id-1" class="ui-tabs-anchor" href="#tabs-1">
                        <?php echo JText::_('Recent Posts'); ?>
                    </a>
                </li>
                <li aria-selected="true" aria-controls="tabs-3" class="ui-state-default ui-corner-top">
                    <a id="ui-id-3" class="ui-tabs-anchor" href="#tabs-3">
                        <?php echo JText::_('Year'); ?>
                    </a>
                </li>
            </ul>
            <div class="ui-tabs-panel" id="tabs-1">
                <?php
                $db = & JFactory::getDBO();
                $sqlitem="SELECT * from #__content where catid='14' and state=1 order by publish_up desc";
                $db->setQuery($sqlitem);
                $rowitems = $db->loadObjectList();
                for($i=0;$i<count($rowitems);$i++){
					$itemdate = $rowitems[$i]->publish_up;
                    $linkrecent='index.php?option=com_content&view=article&id='.$rowitems[$i]->id.':'.$rowitems[$i]->alias.'&catid='.$rowitems[$i]->catid.'&Itemid=109';
                ?>
                    <a href="<?php echo $linkrecent;?>">
                        <?php echo $rowitems[$i]->title;?><br /><span class="datepublish"><?php echo date('jS M, Y', strtotime($itemdate)); ?></span>
                    </a>
                <?php
                }
                ?>
            </div>
            <div class="ui-tabs-panel" id="tabs-3">
                <form action="<?php echo $linkform;?>" method="post" id="yearnews" class="yearnews" name="yearnews" >
					<?php
                    $datenow = date('Y-d-m');
                    $datenow = explode('-',$datenow);
                    $datenow = $datenow[0];
                    for($i=$datenow;$i>=2011;$i--){
						$nameclass="";
						if($wordfind==$i){
							$nameclass = "active";
						}
                    ?>
                        <button id="yearnewsof" name="yearnewsof" class="yearnewsof <?php echo $nameclass;?>" value="<?php echo $i;?>" onclick="formyearnews(<?php echo $i;?>);">
                        <?php echo $i;?>
                        </button>
                    <?php
                    }
                    ?>
                    <input type="hidden" name="yearnewsofinput" id="yearnewsofinput" value="" />
                </form>
            </div>
        </div>
        
    </div>
</div>
<?php
}
else if($this->item->catid==14 || $this->item->catid==33 && $this->item->id!=51){
?>
<div class="page-header">
    <h2 class="wmc_heading1"><?php echo $this->escape($this->item->title); ?>
	
	
		<?php 
		//$itemId = JRequest::getVar("Itemid");
		//if( ($itemId == 142) || ($itemId == 146) || ($itemId == 147) ||($itemId == 148) ||($itemId == 149) ||($itemId == 150) ||($itemId == 151) || ($itemId == 164)):
		
		//echo "<pre>";print_r($rowitems);
		
		if(!empty($contentdetail[0]->button_reservation) && ($contentdetail[0]->button_reservation != "0")):
	?>
	<a href="<?php echo $contentdetail[0]->button_reservation;?>#<?php echo $lang;?>"><div class="reservation reservation_<?php echo $lang; ?>"></div></a>
	
	<?php endif;?>
	</h2>
</div>
<div class="contentmain">
	<div class="leftcontent newswmc">
        <div class="date_socialmedia">
            <span class="datenews"><?php echo JHtml::_('date', $this->item->publish_up, JText::_('DATE_FORMAT_LC3')); ?></span>
        </div>
        <div class="contentnews">
            <div class="entry_image img-intro-left">
            	<?php
				if($this->item->id==54){
				?>
				<a target="_blank" href="http://issuu.com/wmcgroup/docs/wmc_aspire_-_q2_2014?e=12049362/7942170">
					<img src="<?php echo htmlspecialchars($images->image_intro);?>" /> 			
				</a>
				<?php 	
				}
				else{
				?>
					<img src="<?php echo htmlspecialchars($images->image_intro);?>" /> 				
				<?php
				}
				?>
                 
            </div>
            <div class="entry_content">
                <?php echo $this->item->text; ?>
            </div>
        </div>
        <div id="share" class="date_socialmedia">
            <span class="socialmedia"><?php echo JText::_('Share');?>
            <ul>
            <li> 
            <a href="https://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $this->escape($this->item->title); ?>&amp;p[summary]=<?php echo htmlspecialchars($this->item->introtext);?>&amp;p[url]=<?php echo urlencode('http://wmcvietnam.com'.$_SERVER['REQUEST_URI']);?>" target="_blank">
                <img onmouseover="this.src='images/headers/facebook_h.png'" onmouseout="this.src='images/headers/facebook.png'" src="images/headers/facebook.png" alt="Facebook">
            </a>
            </li>
            
            <li> 
            <a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo 'http://wmcvietnam.com'.$_SERVER['REQUEST_URI'];?>" target="_blank">
               <img onmouseover="this.src='images/headers/linkedin_h.png'" onmouseout="this.src='images/headers/linkedin.png'" src="images/headers/linkedin.png" alt="Linked in">
            </a>
            </li>
            <li> 
            <a href="https://plus.google.com/share?url=<?php echo 'http://wmcvietnam.com'.$_SERVER['REQUEST_URI'];?>" target="_blank">
                <img onmouseover="this.src='images/headers/google_h.png'" onmouseout="this.src='images/headers/google.png'" src="images/headers/google.png" alt="Google plus">
            </a>
            </li>
            <li> 
            <a href="http://twitter.com/intent/tweet?url=<?php echo 'http://wmcvietnam.com'.$_SERVER['REQUEST_URI'];?>&text=<?php echo $this->escape($this->item->title);?>" target="_blank">
                <img onmouseover="this.src='images/headers/twitter_h.png'" onmouseout="this.src='images/headers/twitter.png'" src="images/headers/twitter.png" alt="Twitter">
            </a>
            </li>
            </ul>
            </span>
        </div>
    </div>
    <div class="rightcontent slidernews">
    	
        <script src="templates/protostar/js/jquery-ui.js"></script>
		<script>
        jQuery(function() {
            var tabCounter = 2;
            var tabs = jQuery( "#tabs" ).tabs();
            tabs.bind( "keyup", function( event ) {
                if ( event.altKey && event.keyCode === jQuery.ui.keyCode.BACKSPACE ) {
                    var panelId = tabs.find( ".ui-tabs-active" ).remove().attr( "aria-controls" );
                    jQuery( "#" + panelId ).remove();
                    tabs.tabs( "refresh" );
                }
            });
        });
		function formyearnews(yearnewsinput){
			var f=document.getElementById('yearnews');
			document.getElementById('yearnewsofinput').value = yearnewsinput;
			f.submit();
		}
        </script>
        <div class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
            <ul role="tablist" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
                <li aria-selected="true" aria-controls="tabs-1" class="ui-state-default ui-corner-top">
                    <a id="ui-id-1" class="ui-tabs-anchor" href="#tabs-1">
                        <?php echo JText::_('Recent Posts'); ?>
                    </a>
                </li>
                <li aria-selected="true" aria-controls="tabs-3" class="ui-state-default ui-corner-top">
                    <a id="ui-id-3" class="ui-tabs-anchor" href="#tabs-3">
                        <?php echo JText::_('Year'); ?>
                    </a>
                </li>
            </ul>
            <div class="ui-tabs-panel" id="tabs-1">
                <?php
                $db = & JFactory::getDBO();
                $sqlitem="SELECT * from #__content where catid='14' and state=1 order by publish_up desc";
                $db->setQuery($sqlitem);
                $rowitems = $db->loadObjectList();
                for($i=0;$i<count($rowitems);$i++){
					$itemdate = $rowitems[$i]->publish_up;
                    $linkrecent='index.php?option=com_content&view=article&id='.$rowitems[$i]->id.':'.$rowitems[$i]->alias.'&catid='.$rowitems[$i]->catid.'&Itemid=109';
                ?>
                    <a href="<?php echo $linkrecent;?>">
                        <?php echo $rowitems[$i]->title;?><br /><span class="datepublish"><?php echo date('jS M, Y', strtotime($itemdate)); ?></span>
                    </a>
                <?php
                }
                ?>
            </div>
            <div class="ui-tabs-panel" id="tabs-3">
                <form action="<?php echo $linkform;?>" method="post" id="yearnews" class="yearnews" name="yearnews" >
					<?php
                    $datenow = date('Y-d-m');
                    $datenow = explode('-',$datenow);
                    $datenow = $datenow[0];
                    for($i=$datenow;$i>=2011;$i--){
                    ?>
                        <button id="yearnewsof" name="yearnewsof" class="yearnewsof" value="<?php echo $i;?>" onclick="formyearnews(<?php echo $i;?>);">
                        <?php echo $i;?>
                        </button>
                    <?php
                    }
                    ?>
                    <input type="hidden" name="yearnewsofinput" id="yearnewsofinput" value="" />
                </form>
            </div>
        </div>
        
    </div>
</div>
<?php	
}
else{
$db = & JFactory::getDBO();

$sqlitem="SELECT * from #__content where id='".$id."' and state=1";
$db->setQuery($sqlitem);
$rowitems = $db->loadObjectList();

$sqlrelate="SELECT * from #__content where catid='".$rowitems[0]->catid."' and state=1";
$db->setQuery($sqlrelate);
$rowrelates = $db->loadObjectList();
?>

<div class="page-header">
    <h2 class="wmc_heading"> <?php echo $this->escape($this->params->get('page_heading')); ?> 
	<?php 
		//$itemId = JRequest::getVar("Itemid");
		//if( ($itemId == 142) || ($itemId == 146) || ($itemId == 147) ||($itemId == 148) ||($itemId == 149) ||($itemId == 150) ||($itemId == 151) || ($itemId == 164)):
		
		if(!empty($rowitems[0]->button_reservation) && ($rowitems[0]->button_reservation != "0")):
	?>
	<a href="<?php echo $rowitems[0]->button_reservation;?>#<?php echo $lang;?>"><div class="reservation reservation_<?php echo $lang; ?>"></div></a>
	
	<?php endif;?>
	</h2>
</div>

<div class="contentmain">
<?php
	$slide = strip_tags($rowitems[0]->desclocation);
	if(strlen($slide)>0){
?>
	<div class="postcontent nobottommargin">
		<div class="single-portfolio-image">
			<div id="portfolio-slider">
				<div class="flexslider">
					<div class="portfolio-slider-wrap">
                    	<?php
							if($slide=="wph"){			$idbanner = 29;		}
							if($slide=="sherwood"){		$idbanner = 28;		}
							if($slide=="mayfair"){		$idbanner = 27;		}
							if($slide=="ccnh"){			$idbanner = 22;		}
							if($slide=="ducbao"){		$idbanner = 23;		}
							if($slide=="kissho"){		$idbanner = 24;		}
							if($slide=="ngandinh"){		$idbanner = 25;		}
							if($slide=="tott"){			$idbanner = 26;		}
							if($slide=="adplaza"){		$idbanner = 30;		}
							if($slide=="spa"){			$idbanner = 31;		}
							if($slide=="amigo"){		$idbanner = 21;		}
							if($slide=="ccad"){			$idbanner = 3;		}
							if($slide=="reverie"){		$idbanner = 43;		}
							
							$sqlslide="SELECT * from #__banners where catid='".$idbanner."' and state=1";
							$db->setQuery($sqlslide);
							$rowslides = $db->loadObjectList();
							for($i=0;$i<count($rowslides);$i++){
								$imageintroitem = $rowslides[$i]->params;
								$imageintroitem = explode('","',$imageintroitem);
								$imageintroitem = explode('":"',$imageintroitem[0]);
								$imageintroitem = str_replace('\/','/',$imageintroitem[1]);
						?>
                                <!--<a href="<?php echo $imageintroitem;?>" class="triggerLightbox">-->
                                    <img src="<?php echo $imageintroitem;?>" alt="<?php echo $rowslides[$i]->name;?>" title="<?php echo $rowslides[$i]->name;?>" />
                                    <!--<div class="item-overlay overlay-icon-pic"><span></span></div>-->
                                <!--</a>-->
                        <?php
							}
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
    <?php
	}
    else{
		$imageintro = $rowitems[0]->images;
		$imageintro = explode('","',$imageintro);
		$imageintro = explode('":"',$imageintro[0]);
		$imageintro = str_replace('\/','/',$imageintro[1]);
	?>
    <div class="postcontent nobottommargin">
        <div class="single-portfolio-image">
            <!--<a href="<?php echo $imageintro;?>" class="triggerLightbox">-->
                <img src="<?php echo $imageintro;?>" />
                <!--<div class="item-overlay overlay-icon-pic"><span></span></div>-->
            <!--</a>-->
        </div>
    </div>
    <?php
	}
	?>
    
    <div class="portfolio-meta nobottommargin col_last">
		<div class="single-portfolio-description">
			<ul class="desc">
				<li>
                	<?php
                    $logoarticle = $rowitems[0]->images;
					$logoarticle = explode('image_fulltext":"',$logoarticle);
					$logoarticle = explode('","',$logoarticle[1]);
					$logoarticle = str_replace('\/','/',$logoarticle[0]);
					if(strlen($logoarticle)>1){echo '<img class="logoarticle" src="'.$logoarticle.'" />';}
					?>
					<h4>
					<?php
						if($this->item->catid==10){echo JText::_('Working with Us:');}
						else{echo JText::_('Description');}
					?>
					</h4>
					<p>
						<?php echo $rowitems[0]->introtext; ?>
                    </p>
                    <p>
						<?php echo $rowitems[0]->fulltext; ?>
                    </p>
                    <?php
                    if($Itemid == 108){
						$document = &JFactory::getDocument();
						$renderer   = $document->loadRenderer('modules');
						$position   = 'categoriesjob';
						$options   = array('style' => 'none');
						echo $renderer->render($position, $options, null);
					}
					?>
				</li>
            </ul>
            
		</div>
	</div>
    
	<?php
    if(count($rowrelates)>1 && $this->item->catid!=15){
	?>
    
	<div class="doubleline"></div>
    <div class="related-projects-wrap clearfix ourporfolio">
		<h3><?php echo JText::_('Our Managed Properties');?></h3>
		<div id="home-portfolio-list" class="clearfix">
            <div id="portfolio" class="portfolio-normal clearfix">
			<?php
            //fitter menu id
            $wordfind = 'view=article';
            $sqlmenu="SELECT * from #__menu where link like '%$wordfind%' and published=1";
            $db->setQuery($sqlmenu);
            $rowitemidmenus = $db->loadObjectList();
            //fitter menu id
            for($i=0;$i<count($rowrelates);$i++){
                
                //fitter menu id
                $Itemidmenu = "";
                for($m=0;$m<count($rowitemidmenus);$m++){
                    $idarticle = $rowitemidmenus[$m]->link;
                    $idarticle = explode('&id=',$idarticle);
                    if($idarticle[1]==$rowrelates[$i]->id){$Itemidmenu = $rowitemidmenus[$m]->id;}
                }
                if($Itemidmenu!=""){
                    $itemidneed = "&Itemid=".$Itemidmenu;
                }
                //fitter menu id
                
                $imageintrorelate = $rowrelates[$i]->images;
                $imageintrorelate = explode('","',$imageintrorelate);
                $imageintrorelate = explode('":"',$imageintrorelate[0]);
                $imageintrorelate = str_replace('\/','/',$imageintrorelate[1]);
                
                $linkrelate='index.php?option=com_content&view=article&id='.$rowrelates[$i]->id.':'.$rowrelates[$i]->alias.'&catid='.$rowrelates[$i]->catid.$itemidneed;
            ?>
                <div class="portfolio-item">
                    <div class="portfolio-image">
                        <a href="<?php echo $linkrelate;?>"><img src="<?php echo $imageintrorelate;?>" />
                            <div class="item-overlay overlay-icon-pic"><span></span></div>
                        </a>
                    </div>
                    <div class="portfolio-desc"><h3><a href="<?php echo $linkrelate;?>"><?php echo $rowrelates[$i]->title; ?></a></h3></div>
                </div>
            <?php
            }
            ?>
            </div>
            <div class="portfolio-navigation">
                <a href="#" id="home-portfolio-prev" class="portfolio-prev">Previous</a> 
                <a href="#" id="home-portfolio-next" class="portfolio-next">Next</a>
            </div>
            <div id="home-portfolio-pagination"></div>
            <script type="text/javascript">
			jQuery("#portfolio").carouFredSel({
				circular:false,
				responsive:true,auto:false,
				items:{width:300,visible:{min:1,max:4}},
				scroll:{duration:900,easing:"easeOutExpo",wipe:true},
				prev:{button:"#home-portfolio-prev",key:"left"},
				next:{button:"#home-portfolio-next",key:"right"},
				pagination:"#home-portfolio-pagination"});
			</script>
		</div>
        
	</div>
    <?php
	}
	?>
</div>
<?php
}
?>